import static org.junit.Assert.assertEquals;
import org.easymock.EasyMock;
import org.junit.Test;
public class ATest {
	@Test
	public void test_m() {
		B b = EasyMock.createMock(B.class);
		A a = new A(b);
		EasyMock.expect(b.inc(1)).andReturn(2);
		EasyMock.expect(b.inc(2)).andReturn(3);
		EasyMock.replay(b);
		assertEquals(a.inc2(1),3);
		EasyMock.verify(b);
	}
	@Test
	public void test_m1() {
		//niceMock
		
		B bnm = EasyMock.createNiceMock(B.class);
		A anm = new A(bnm);
		
		EasyMock.expect(bnm.inc(1)).andReturn(2);
		EasyMock.expect(bnm.inc(2)).andReturn(3);
		EasyMock.replay(bnm);
		assertEquals(anm.inc2(1),3);
		EasyMock.verify(bnm);
	}
	
}